UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Kf+lSzKB657/eyCIVP2mSpuvwKJ6f++B/D7UP5CxUiM=' 
WHERE 
  key_id = 'c80a0b3fd332442accaf0078710bc585e87d2c5a0b1fc6c52c97821d77ce07d8' 
  AND (
    token = 'Kf+lSzKB657/eyCIVP2mSpuvwKJ6f++B/D7UP5CxUiM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020