UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y7kbhePvJQcW2PZL5TF8l2tfDE+PNI/2SMjRts2mUt8='
WHERE
key_id = '968fd96cfc892f9e2050c4b62ef9cf66afd41779dcd698921423d2fc398bcb31'
AND (
token = 'Y7kbhePvJQcW2PZL5TF8l2tfDE+PNI/2SMjRts2mUt8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)