UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xIkRDtRaFygokcxHlPNO2YBUWZBLMrhag5yk0+ZVNLk='
WHERE
key_id = '3b071d0665a6e7d8fa65b131d44f25ede4fcd40252b8a4001386844bdbca5d68'
AND (
token = 'xIkRDtRaFygokcxHlPNO2YBUWZBLMrhag5yk0+ZVNLk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)