UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6+zxTHrECgwm0a6fpuBxt/Bb10QDu2WQG2jWii/m1yo='
WHERE
key_id = '7f8a7a7d60d851d5477d0247dd78a5b996c6d41cc8ee57267f0d19be9ec3e9a6'
AND (
token = '6+zxTHrECgwm0a6fpuBxt/Bb10QDu2WQG2jWii/m1yo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)