UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ouHAwA+O3QqvHXeeNbtPhb9c2jgsoeqqX0Zp9oUjR2w='
WHERE
key_id = 'c4d7d5ec439c92754b14a06e388772eda661b07eaae83fbc548493ef560bdde3'
AND (
token = 'ouHAwA+O3QqvHXeeNbtPhb9c2jgsoeqqX0Zp9oUjR2w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)