UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6heQphuEfZC02st4pXDWvIggYnezmYxmW8hdgq7n5Qo='
WHERE
key_id = '6545f96b18b8abebf7232f95064413f6bd255eb8825eba01256db0306d0b7c35'
AND (
token = '6heQphuEfZC02st4pXDWvIggYnezmYxmW8hdgq7n5Qo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)