UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aKY+/o6l96HbuuWswmHpAnvmCR6XMz5Gk+gHJozjFdI='
WHERE
key_id = 'c2b26c422d8d919bb8087aa3e7c4f55bfa5f9e49ad5cff1b959e531ed0726023'
AND (
token = 'aKY+/o6l96HbuuWswmHpAnvmCR6XMz5Gk+gHJozjFdI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)