UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jVb9UVUXdIKZbpd5ct5yI59WZGFyTChcmA7zzf07XyQ=' 
WHERE 
  key_id = '02c93d38fdd2f45c8f2721c5e0faf4fc209d9f2c683bae34e5107b1ab8a28bd1' 
  AND (
    token = 'jVb9UVUXdIKZbpd5ct5yI59WZGFyTChcmA7zzf07XyQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032