UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Yd0xEAX4CYhKlt70U+Md33EMZsg7othnvFSI7DX6qg='
WHERE
key_id = '2d42c3beafd97143a4c577bdc9615ae38c4cfc6c25a214c8d14d42ca97899add'
AND (
token = '3Yd0xEAX4CYhKlt70U+Md33EMZsg7othnvFSI7DX6qg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)