UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2+Bij++ocNSmf0ZKJ4DijIUDH3+PXlLIUi8EjFFn+YM=' 
WHERE 
  key_id = '3feb7d2518e337fe5275a24ee84e7f91e1c5bcd7961ede27b6445a83f5218b14' 
  AND (
    token = '2+Bij++ocNSmf0ZKJ4DijIUDH3+PXlLIUi8EjFFn+YM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024