UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qT489rs27MLxMvAgtaDSy15H1oCTC7MLFew41JTHeeo='
WHERE
key_id = '81fc4cb9790f891ca9686d53e8eae60625179ed9c421ccae21fab9dd9732dafe'
AND (
token = 'qT489rs27MLxMvAgtaDSy15H1oCTC7MLFew41JTHeeo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)