UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/ZgotURVVfUTo690Xchx77uhr4vBnu6xs/qPwJgtrIg='
WHERE
key_id = '05beb49f51382230ab753df8cb691dc2005b749d61614cda44adc6f571e72e29'
AND (
token = '/ZgotURVVfUTo690Xchx77uhr4vBnu6xs/qPwJgtrIg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)