UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9XD/jfG0PLjWg4Bb73YM2bSDr4oeXPk0tgw7c19xM2g='
WHERE
key_id = 'cd1f6664fc19aeec2a010c385104cd054fabe0af1a49cd556bb396bb43a14267'
AND (
token = '9XD/jfG0PLjWg4Bb73YM2bSDr4oeXPk0tgw7c19xM2g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)