UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5Oled/YCcT9ZMYCVkdrPtoVZYO8mo5Prxu0LSwlKKsU=' 
WHERE 
  key_id = 'a012b5d9416b088eb9472c0300e348669f1e1e979ac878786952ea34c19e4052' 
  AND (
    token = '5Oled/YCcT9ZMYCVkdrPtoVZYO8mo5Prxu0LSwlKKsU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049