UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p/gdNE4WVKjkk4t5/4f0YE4K6ZE1OFv5n4xf3BGOuzE='
WHERE
key_id = 'ad19883f05fa96a41a2f22cf91537abb5ba1c5f977c2090829fa93d84cd90ab5'
AND (
token = 'p/gdNE4WVKjkk4t5/4f0YE4K6ZE1OFv5n4xf3BGOuzE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)