UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'suomNhYJ1x2azm5aQGdMYBXz80i/rKuNLjCc2gi2c4I='
WHERE
key_id = 'd5f14591dc028981dbcc45f53d66c416a1d37d8cdbb7223b9f86701a2afb4faf'
AND (
token = 'suomNhYJ1x2azm5aQGdMYBXz80i/rKuNLjCc2gi2c4I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)