UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'me26MMnuM0DdeBMSq/YZCv08wBJduVr53iDACrLVrI8='
WHERE
key_id = '7aa9db74204a11ff2d1b3de3c06ada75c8bef938e89ea49e055819313895a6ec'
AND (
token = 'me26MMnuM0DdeBMSq/YZCv08wBJduVr53iDACrLVrI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)