UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6U9c0Si3g6VEse7oOMSJR3jiQIgwOrjIr8WdbssA9QE='
WHERE
key_id = '574d8c52d344fd23293768d8710f6ce06692fa28bf6149fab6a39a5311a26282'
AND (
token = '6U9c0Si3g6VEse7oOMSJR3jiQIgwOrjIr8WdbssA9QE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)