UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c4Sr61kPCjtwXVGrIeLIM+EaYlOMguiLQPrW1IhnHhY='
WHERE
key_id = '01b0f56a6e42f95ddf164b25aa85dfe964bff06f4021677970a5eb7a5861e45a'
AND (
token = 'c4Sr61kPCjtwXVGrIeLIM+EaYlOMguiLQPrW1IhnHhY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)