UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm6mNmRi9iy7JsVOY0Kd/L3+4q7VJav88xnjCMEq7HP4=' 
WHERE 
  key_id = '5f73a11285a88ea9a9543c4077dc310edbdc20bdbb0d40beda0f2fcf0e784db7' 
  AND (
    token = 'm6mNmRi9iy7JsVOY0Kd/L3+4q7VJav88xnjCMEq7HP4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035