UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '76NYYsoj0FBA09oEGQ2NGKABiAUXXuwNK1nlLTkhNkA='
WHERE
key_id = 'b6e23457cb3f0445ee305c6162145db288fae5a470e924ff21f078d2ddc001ec'
AND (
token = '76NYYsoj0FBA09oEGQ2NGKABiAUXXuwNK1nlLTkhNkA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)