UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LXFKti2PVrCxEKkJAVxj+yLniEdxRWSBwuPOqfudmTA='
WHERE
key_id = '0351c5092c743146cc6d279f6eca1f12398a39c5080215f213d6c75822d02500'
AND (
token = 'LXFKti2PVrCxEKkJAVxj+yLniEdxRWSBwuPOqfudmTA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)