UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8XE0FYN0fP5pxVJ8asUJw6uKd0B+Ft/H8kmqmv2XmEw=' 
WHERE 
  key_id = '61c999c6eb6a2cc298da62cd3402005cd9cb27ee0580befb46ec4350f3839a18' 
  AND (
    token = '8XE0FYN0fP5pxVJ8asUJw6uKd0B+Ft/H8kmqmv2XmEw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027