UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LLfWZHKUTAyGicP4rT+jUwODVs7X5KIvwaj1dXqC0e4=' 
WHERE 
  key_id = '554490a13af6294751bf59e013eaf019a00b5b096bd5a24b2c7a2a226eb77628' 
  AND (
    token = 'LLfWZHKUTAyGicP4rT+jUwODVs7X5KIvwaj1dXqC0e4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022