UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z5mbwwujrcBgg2u5ZIFbPYCJ2ED2uMCRvPDglglr2Q8='
WHERE
key_id = '532ffe52ae051ab5aba8e4dea51c54ab6f97f7b737fd88e7a0ca4edf732813da'
AND (
token = 'z5mbwwujrcBgg2u5ZIFbPYCJ2ED2uMCRvPDglglr2Q8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)