UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8cKGLsGsHVNjfOoTdTOF1nFRx4LlEGNNWDCC5ahnUjU=' 
WHERE 
  key_id = 'aea03c2736d0182816bab880fa1d3458f57238498a08db286ba45116a3b00157' 
  AND (
    token = '8cKGLsGsHVNjfOoTdTOF1nFRx4LlEGNNWDCC5ahnUjU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021