UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KSwMtRDytW3U54tH5A3m+xth9NZeLtQ88fjMkb2kAes='
WHERE
key_id = '2821b391d53cd9c9375f853293d1c26538fe59e4dd1d1fab4bf9fb3c1827155f'
AND (
token = 'KSwMtRDytW3U54tH5A3m+xth9NZeLtQ88fjMkb2kAes='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)