UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WyJw4umBIEjYrleyxwc9jDOTjXcf1leI+fGIA7Qy0+o='
WHERE
key_id = '11637833fddb5c90bc73331344f281f76810601cc44e39a7bf1d0aba125d71e5'
AND (
token = 'WyJw4umBIEjYrleyxwc9jDOTjXcf1leI+fGIA7Qy0+o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)