UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wAGcRjb7ZOCLxu3v62FKIlBoTIgeezqMlmNjXWEjrKs=' 
WHERE 
  key_id = 'fe96c5f8c7d403920241850e88cc449f1c93af153a15e9b0c4c91f8e84b21906' 
  AND (
    token = 'wAGcRjb7ZOCLxu3v62FKIlBoTIgeezqMlmNjXWEjrKs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040