UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K4nms9KEwx12zYs3Gu6SMWX7s+SP/RxPGk4Z/1wttvE='
WHERE
key_id = '7e05ae2d96aee0dbb6cf8897462fa52e2acf533e016a3e29bb528b7a5d6d19eb'
AND (
token = 'K4nms9KEwx12zYs3Gu6SMWX7s+SP/RxPGk4Z/1wttvE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)