UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iTEkp7C/8pwaW2wnf12K1Plx4B2yngR/LA6DAmIGSH8='
WHERE
key_id = '1bda0551063e800ae610ff9f7bb06332ae4364f37f7a65a6265f9df034b418b5'
AND (
token = 'iTEkp7C/8pwaW2wnf12K1Plx4B2yngR/LA6DAmIGSH8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)