UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TQ3z/5UsGnrYgPMM+08JL4XDfjFsuZbKLNy7IDEkYDI='
WHERE
key_id = '2adbb06765cc66fa9153189842f8bf6166d9ae2b5d851ba7b453ef6512d7f198'
AND (
token = 'TQ3z/5UsGnrYgPMM+08JL4XDfjFsuZbKLNy7IDEkYDI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)