UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sMJw9HrYJlR2dVvLqZ3FGUoueGckNppcB/0XZ+JDHjM=' 
WHERE 
  key_id = '4f51dbe4a6cf8db5b266cbe70e1de4d69fadc997049e38564484f3d2c188fd3d' 
  AND (
    token = 'sMJw9HrYJlR2dVvLqZ3FGUoueGckNppcB/0XZ+JDHjM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00118