UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N6b36s0KsaYHJEk/0bbL6C8tLhkycha/M3GR7TG3erQ=' 
WHERE 
  key_id = '82b079c88d679643305f819ad8fa0e2302faec884749e97ebded4fbc63752a07' 
  AND (
    token = 'N6b36s0KsaYHJEk/0bbL6C8tLhkycha/M3GR7TG3erQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032