UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XznuMoPSh9Xja1Uk5anBFykZRW4oPYVzEqgXA+cnZ7c='
WHERE
key_id = '7e27e276f0d643332d73133aaee172071aa70a78dd45b9cae52863ec5b72ee85'
AND (
token = 'XznuMoPSh9Xja1Uk5anBFykZRW4oPYVzEqgXA+cnZ7c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)