UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eEDXaPFGkwlO37nv52AesOQnAYCRGKIkSuES63YSsuA='
WHERE
key_id = '429e5d92dd475e9dd37dcdea76bf9269be73404323160a08a53da14c7357560f'
AND (
token = 'eEDXaPFGkwlO37nv52AesOQnAYCRGKIkSuES63YSsuA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)