UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '94UgvPkm2py7ugM79FW1E9EVXnKGfYBfnYG3ZyctVKc='
WHERE
key_id = '0caa388854946568bc04c7f7f937955c08c05e42f620effe4cce5cba44182c7a'
AND (
token = '94UgvPkm2py7ugM79FW1E9EVXnKGfYBfnYG3ZyctVKc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)