UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T8+IZSASkjuT5/PXOEKHvk6GT/dPgpqL92t552bbaIs='
WHERE
key_id = '7a67180539d4bbbc2aa16eedc22d4be41d000fa6acb1b8496b63392fdc79ff4a'
AND (
token = 'T8+IZSASkjuT5/PXOEKHvk6GT/dPgpqL92t552bbaIs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)