UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xqhIxtwD4rCJPMW68XfHEUAqBdy1kc1YhGXyzlYwbh8=' 
WHERE 
  key_id = '61c8a249963e6f07679f0e0402b4ec36225a0de0d787385927b68b17e0810a4d' 
  AND (
    token = 'xqhIxtwD4rCJPMW68XfHEUAqBdy1kc1YhGXyzlYwbh8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035