UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aKL/vPM8CRz8cFDd6751mOOc18Z77LFKCdtK4jbIVuc='
WHERE
key_id = '27492b3af3e8f345b36e60db9608cf5f78ef25bd47d82e00f4f46c2edc8bcf36'
AND (
token = 'aKL/vPM8CRz8cFDd6751mOOc18Z77LFKCdtK4jbIVuc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)