UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uiEisHtbbiUhzWYuDC2boiBs40d10Spz+ODRynKdG5E='
WHERE
key_id = '910b3570e4279dcee1e714cce4bf06f34a10bec8dff1defaf07481b557ce2996'
AND (
token = 'uiEisHtbbiUhzWYuDC2boiBs40d10Spz+ODRynKdG5E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)