UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w9gJiXUMAMmohYD2yasciQzShEvV6rFGEGAu5pW63u0='
WHERE
key_id = 'ed8d84a370f78e478f357aa99d9ef7a67c45397b241f466449abe4a4f6ac5bde'
AND (
token = 'w9gJiXUMAMmohYD2yasciQzShEvV6rFGEGAu5pW63u0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)