UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wq0Qeel1RRjMZ1+w1iOFmiQIvzqv6dY6hp3C/8k3U7A=' 
WHERE 
  key_id = 'b471a0f5467b0b313667d4af703e3c393e6eba10612dacfd7be316dcf58733c2' 
  AND (
    token = 'Wq0Qeel1RRjMZ1+w1iOFmiQIvzqv6dY6hp3C/8k3U7A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029