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

Query time 0.00042