UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '68Z5CCTpcYt+W2SQMzVO+lh2n4CvYlEqeTnoLVQ8dt0='
WHERE
key_id = 'db268bef2e4295c7ea8d6b6461ee9968b502087c0186eb3785330ae2491bbe16'
AND (
token = '68Z5CCTpcYt+W2SQMzVO+lh2n4CvYlEqeTnoLVQ8dt0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)