UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3VQrCfRDv7obNXsSq/kZZkbzoNyr0VdVYH2WmjR7o5c='
WHERE
key_id = 'c7355b8238372d94dc6822a113b58b97ac605c7b7d78ea25a1583928b75f9652'
AND (
token = '3VQrCfRDv7obNXsSq/kZZkbzoNyr0VdVYH2WmjR7o5c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)