UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Uvmc6T3HIKjk52O1AXH+A/geJV/YI7fgeB65OQuQmc='
WHERE
key_id = '966e0eae4d1dc07a6af01dbd4e80b85e72bb381dc4a7c5496ce2755ae5d57e79'
AND (
token = '1Uvmc6T3HIKjk52O1AXH+A/geJV/YI7fgeB65OQuQmc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)