UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9nv9EJCFm28Z7UnmhdBIl4PnqXoU3ST8DSdEaPsSqDA=' 
WHERE 
  key_id = 'f2669df9948ec5c92cb8234dead6b5511236bbab99c17cde2106762fdf7264a8' 
  AND (
    token = '9nv9EJCFm28Z7UnmhdBIl4PnqXoU3ST8DSdEaPsSqDA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043