UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h7ek/QqhWhN+qR/c00QOjfZOEHpBZzwlwjbSpttx3vA=' 
WHERE 
  key_id = '76e69451943594931138f189eec3d5b69d9729580a93eadf3361423b8c48a2a5' 
  AND (
    token = 'h7ek/QqhWhN+qR/c00QOjfZOEHpBZzwlwjbSpttx3vA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015