UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+aS5cF8B24Gf18j3Saviwa75szvVbPgmE9BIGlIZhaw='
WHERE
key_id = '1cb5e019eb01e8add763101306d8edfdaccf90d9e782bc2cc8175166b4bb4560'
AND (
token = '+aS5cF8B24Gf18j3Saviwa75szvVbPgmE9BIGlIZhaw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)