UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cYk+92fWjfQlF11Zn+bFni8sWjq7AFjZAckFMv7ggNs=' 
WHERE 
  key_id = 'cb34dd5ec6f03519cc71dbdd79ae31c4a28a00b5a590324e41d32c41a493d680' 
  AND (
    token = 'cYk+92fWjfQlF11Zn+bFni8sWjq7AFjZAckFMv7ggNs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025