UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mwJiiEqMqMZFLxX1xHelcH/W4juQFQe5IN60gSCJj4U=' 
WHERE 
  key_id = '9b408b8f4fad49da11ea1558d8a763407e7b63abdd37a3b76240c9ddd219cb15' 
  AND (
    token = 'mwJiiEqMqMZFLxX1xHelcH/W4juQFQe5IN60gSCJj4U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032