UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J1SMQEe6PKGLxdK2IWGhC0W+gvGWsNMp3vZZJDzP/m8=' 
WHERE 
  key_id = '7a232f1618fbc191469ab70a0a3d0d95c643e9413c8eb9bb3f80c205147f130d' 
  AND (
    token = 'J1SMQEe6PKGLxdK2IWGhC0W+gvGWsNMp3vZZJDzP/m8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021