UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H7hiJ7xJW4NbOYjrvQkR0tlgiVsJc6znyqT+3tAcKok=' 
WHERE 
  key_id = '92710896357b5433a432741179396aa0281d82d3f5db405b197ba975b41568b9' 
  AND (
    token = 'H7hiJ7xJW4NbOYjrvQkR0tlgiVsJc6znyqT+3tAcKok=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030