UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BOwuiZd8g0hwxuWMJ/835dx0xciTP+rK02uOSIBW4Ho=' 
WHERE 
  key_id = '98dea2a2ba6beaddb94d2aa446a2805c7e3e10e678e5c7d0715f458662b800a8' 
  AND (
    token = 'BOwuiZd8g0hwxuWMJ/835dx0xciTP+rK02uOSIBW4Ho=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044